package com.tsmti.system.entity;

import com.tsmti.core.common.entity.BaseDataEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Package：com.tsmti.system.entity
 * @Class：DataSource
 * @Description： TODO
 * @Author：zcw
 * @Date：Created in 2018/6/5 17:23
 * @Company:
 * @Version：
 * @Modified By:
 */
@Entity
@Table(name = "pims_datasource")
@DynamicUpdate
@DynamicInsert
@Where(clause = "delFlag = 0")
public class DataSource extends BaseDataEntity<Long>{

    private static final long serialVersionUID = 3539922062556592433L;
    /**id*/
    private Long id;
    /**索引关键字*/
    private String dbKey;
    /**驱动*/
    private String driverClass;
    /**数据库名称*/
    private String dbName;
    /**密码*/
    private String dbPassword;
    /**数据库类型*/
    private String dbType;
    /**描述*/
    private String description;
    /**URL*/
    private String url;
    /**帐号*/
    private String dbUser;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_DataSource")
    @SequenceGenerator(name = "SEQ_DataSource", sequenceName = "datasource_sequence", allocationSize = 1)
    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    public String getDbKey() {
        return dbKey;
    }

    public void setDbKey(String dbKey) {
        this.dbKey = dbKey;
    }

    public String getDriverClass() {
        return driverClass;
    }

    public void setDriverClass(String driverClass) {
        this.driverClass = driverClass;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getDbPassword() {
        return dbPassword;
    }

    public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
    }

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDbUser() {
        return dbUser;
    }

    public void setDbUser(String dbUser) {
        this.dbUser = dbUser;
    }
}
